package com.samapp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Application;
import android.graphics.Bitmap;
import android.util.Log;

import com.baidu.mapapi.model.LatLng;
import com.samapp.entity.Client;
import com.samapp.entity.DetectionItem;
import com.samapp.entity.Indent;
import com.samapp.entity.User;

public class MyApplication extends Application {

	private static final MyApplication myApplication = new MyApplication();
	/** 存储标记 */
	public String sharedPreferencesFlag = "samapp";
	/** 当前登录用户 */
	public User currentUser;
	/** 订单 数组 */
	public List<Indent> mIndents = new ArrayList<Indent>();
	/** 模拟接口返回JSON数据 */
	public String strTest = "{'code':'0', 'msg':'执行成功', 'cname':'张三'}";
	/** 签名 */
	public Bitmap bitmapAutograph = null;
	public String databaseName = "samapp.db";
	public String tableName = "client";
	public String createTable = "CREATE table client (fid INTEGER primary key, cname text, ename text, number text, type text, ccontacts text, econtacts text, phone text, mobile text, fax text, email text, addresscn text, addressen text, remark text, longitude text, latitude text);";
	/** 数据库版本 */
	public int databaseVesion = 1;
	public String url = "http://112.126.81.77:9900/sams/app/";
	public String url2 = "http://112.126.81.77:9900/sams/";
	/** 食品添加剂网址 */
	public String foodAdditivesUrl = "http://db.foodmate.net/2760-2014/";
	public String test = "ceshi";
	/** 新添加的订单 */
	public Indent newIndent = new Indent();
	/** 查询得到的符合条件的检测项目数组 */
	public List<DetectionItem> listDetectionItem = new ArrayList<DetectionItem>();
	/** 当前登录用户的ID */
	public String userId = "4";
	/** 地图中心点 */
	public LatLng curCenPT = new LatLng(0, 0);

	/** 客户列表 */
	public Map<String, Client> clientsMap = new HashMap<String, Client>();

	/** 当前选中的客户 */
	public String curClientFid = "";

	/** 当前选中的检测项目 */
	public String curDetetionFid = "";

	@Override
	public void onCreate() {
		Log.i("save", "测试执行时间");
		super.onCreate();
	}

	/**
	 * 没有Context对象的类中获取Application对象
	 * 
	 * @return AppContext实例
	 */
	public static MyApplication getApplicationInstance() {
		return myApplication;
	}
}